package com.rp.configure.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rp.configure.entity.Device;
import com.rp.configure.entity.DeviceAttribute;
import com.rp.configure.mapper.DeviceMapper;
import com.rp.configure.service.DeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author vicente
 * @since 2021-07-16
 */
@Service
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService {
    @Autowired
    DeviceMapper deviceMapper;
    @Override
    public IPage<Device> listPage(Page page,String gatewayId) {
        return deviceMapper.listPage(page,gatewayId);
    }

    @Override
    public List<Device> listByGateway(QueryWrapper<DeviceAttribute> queryWrapper) {
        return deviceMapper.listByGateway(queryWrapper);
    }
}
